import matplotlib.pyplot as plt
import numpy as np
x_arange=np.arange(0,2*np.pi,0.1)
y_arange=np.sin(x_arange)
# 生成等间隔数组
x_listspace=np.linspace(0,2*np.pi,100)
y_listspace=np.sin(x_listspace)
# 绘制正弦曲线
plt.figure(figsize=(12,4))
plt.subplot(1,2,1)
plt.title("Using arange()")
plt.legend

plt.subplot(1,2,2)
plt.plot(x_listspace,y_listspace,label='linspace')
plt.title('Using linspace')
plt.legend()

plt.show()